package com.atguigu.lease.web.app.mapper;

import com.atguigu.lease.model.entity.LabelInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author liubo
* @description 针对表【label_info(标签信息表)】的数据库操作Mapper
* @createDate 2023-07-26 11:12:39
* @Entity com.atguigu.lease.model.entity.LabelInfo
*/
public interface LabelInfoMapper extends BaseMapper<LabelInfo> {
    @Select("select id, type, name from label_info li where id in " +
            "(select label_id from room_label rl where room_id=#{roomId} and rl.is_deleted=0 ) and li.is_deleted=0")
    List<LabelInfo> listLabelByRoomId(Long roomId);

    @Select("select id, type, name from label_info li where id in " +
            "(select label_id from apartment_label al where apartment_id=#{id} and al.is_deleted=0 ) and li.is_deleted=0")
    List<LabelInfo> listLabelByApartmentId(Long id);
}




